<h2>题目编号 : 196</h2>
<div style="color:#666;font-size:80%;">30 May 2008</div><br />
<div class="problem_content">
<p>Build a triangle from all positive integers in the following way:</p>

<p style="font-family:courier new,monospace;font-weight:bold;margin-left:50px;">&nbsp;1<br />
&nbsp;<span style="color:red;">2</span>&nbsp; <span style="color:red;">3</span><br />
&nbsp;4&nbsp;&nbsp;<span style="color:red;">5</span>&nbsp;&nbsp;6<br />
&nbsp;<span style="color:red;">7</span>&nbsp;&nbsp;8&nbsp;&nbsp;9 10<br />
<span style="color:red;">11</span> 12 <span style="color:red;">13</span> 14 15<br />
16 <span style="color:red;">17</span> 18 <span style="color:red;">19</span> 20 21<br />
22 <span style="color:red;">23</span> 24 25 26 27 28<br />
<span style="color:red;">29</span> 30 <span style="color:red;">31</span> 32 33 34 35 36<br />
<span style="color:red;">37</span> 38 39 40 <span style="color:red;">41</span> 42 <span style="color:red;">43</span> 44 45<br />
46 <span style="color:red;">47</span> 48 49 50 51 52 <span style="color:red;">53</span> 54 55<br />
56 57 58 <span style="color:red;">59</span> 60 <span style="color:red;">61</span> 62 63 64 65 66<br />
. . .</p>

<p>Each positive integer has up to eight neighbours in the triangle.</p>

<p>A set of three primes is called a <i>prime triplet</i> if one of the three primes has the other two as neighbours in the triangle.</p>

<p>For example, in the second row, the prime numbers 2 and 3 are elements of some prime triplet.</p>

<p>If row 8 is considered, it contains two primes which are elements of some prime triplet, i.e. 29 and 31.<br />
If row 9 is considered, it contains only one prime which is an element of some prime triplet: 37.</p>

<p>Define S(<var>n</var>) as the sum of the primes in row <var>n</var> which are elements of any prime triplet.<br />
Then S(8)=60 and S(9)=37.</p>

<p>You are given that S(10000)=950007619.</p>

<p>Find &nbsp;S(5678027) + S(7208785).</p>

</div><br />
